/*
 * Main.cpp
 *
 *  Created on: Apr 20, 2011
 *      Author: erwin
 */
#include <iostream>


#include "core/FS.h"
#include "testset/TestSet.hpp"
#include <fcntl.h>

using namespace std;
int main() {
	FS* fs = new FS("floppie");
	/*
	cout << "open" << endl;
	int filedes = fs->open("/filsys/ino.h", O_RDONLY);
	cout << "filedes: " << filedes << endl;
	char content[1582];
	cout << "read" << endl;
	int readsuccess = fs->read(filedes, content, 1582);
	cout << "response: " << readsuccess << endl << endl;
	cout << content << endl << endl;
	cout << "lseek" << endl << endl;
	cout << fs->lseek(filedes, 0, 0) << endl;
	cout << "write" << endl;
	char* input = "replace";
	cout << fs->write(filedes, input, 7) << endl;
	cout << "result" << endl;
	fs->lseek(filedes, 0, 0);
	readsuccess = fs->read(filedes, content, 1582);
	cout << content << endl;
	cout << "remove, should fail since the file is still opened" << endl;
	cout << fs->remove("/filsys/ino.h") << endl;
	cout << "close" << endl;
	cout << fs->close(filedes) << endl;
	cout << "remove" << endl;
	cout << fs->remove("/filsys/ino.h") << endl;
	cout << "unlink" << endl;
	cout << fs->unlink("/") << endl;
	cout << "creat" << endl;

	int filedes = fs->open("/hey.txt", O_RDONLY);
	char output[22];
	fs->read(filedes, output, 22);
	cout << output << endl;
	cout << "still alive?" << endl;
	*/

}
